<?php
session_start();
$sessionid = session_id();
$servername = "localhost";
$username = "root";
$password = "wgz52157";
$dbname = "myFirstDB";
// 创建连接
$conn = new mysqli($servername, $username, $password, $dbname);
//获得当前组数
$groupnum = 0;
$getgroupnum = mysqli_query($conn, "SELECT *FROM MyUsers WHERE id='$sessionid'");
while ($group = mysqli_fetch_array($getgroupnum)) {
    $groupnum = $group['groupnum'];
}
$out;
$nowgroupnum = mysqli_query($conn, "SELECT *FROM MyUsers  WHERE groupnum=$groupnum");
$out=mysqli_num_rows($nowgroupnum);
echo $out;
?>